﻿using System;
using rlTodayMakeSkin.Project.XmlElement;

namespace rlTodayMakeSkin.Project.XmlElement.Properties
{
    /// <summary>
    /// represents a single property of a skin elmement
    /// </summary>
    public class XmlElementProperty
    {
        private string propName;
        private Object propValue;
        private PropertyTypes propType;
        private string description;
        private SupportedVersion version;
        private bool blnRop;

        public XmlElementProperty(string name, Object val, PropertyTypes t, string descr, SupportedVersion sv, bool blnReadOlny)
        {
            propName = name;
            propValue = val;
            propType = t;
            description = descr;
            version = sv;
            blnRop = blnReadOlny;
        }

        /*********************************
         PUBLIC MEMBERS
         ********************************/

        /// <summary>
        /// Gets name of the property
        /// </summary>
        public string Name
        {
            get { return propName; }
        }

        /// <summary>
        /// Gets, sets current value of the property
        /// </summary>
        public Object Value
        {
            get { return propValue; }
            set { propValue = value; }
        }

        /// <summary>
        /// Gets the type of the property
        /// </summary>
        public PropertyTypes PropertyType
        {
            get { return propType; }
        }

        /// <summary>
        /// Gets description for this property
        /// </summary>
        public string Description
        {
            get { return description; }
        }

        /// <summary>
        /// Returns the version in wich this property was introduced
        /// </summary>
        public SupportedVersion Version
        {
            get { return version; }
        }

        /// <summary>
        /// Returns true if this is a read only property
        /// </summary>
        public bool IsReadOnly { get { return blnRop; } }
    }
}
